package com.inexas.cu.stratus;

import javax.jdo.annotations.*;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") 
public class TestEntity implements Entity {
    private static final long serialVersionUID = -2966975879689387872L;

    public final static int OLD = 23;
    public final static int YOUNG = 7;
	public final static String OLD_MAN_NAME = "Andy";
	public final static String YOUNG_MAN_NAME = "Bob";
	public final static TestEntity oldMan, youngMan;
	static {
		oldMan = new TestEntity(OLD_MAN_NAME, OLD);
		youngMan = new TestEntity(YOUNG_MAN_NAME, YOUNG);
	}
	
    @PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long ident;

    private String name;
	private int age;

	public TestEntity(String name, int age) {
		this.name = name;
		this.age = age;
    }

	public Long getIdent() {
	    return ident;
    }

	public String getName() {
    	return name;
    }

	public void setAge(int age) {
	    this.age = age;
    }

	public int getAge() {
    	return age;
    }

	@Override
    public String toString() {
		return "TestEntity(" + name + ", " + age + ')';
    }

}
